import { bootstrapApplication } from '@angular/platform-browser';
import { AppModule } from './app/app.module';
import { AppComponent } from './app/app.component';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { infinityTheme } from 'ng-devui/theme-collection';
import {  devuiLightTheme,  ThemeServiceInit} from 'ng-devui/theme';

ThemeServiceInit({
  'devui-light-theme': devuiLightTheme,
  'infinity-theme': infinityTheme,
}, 'infinity-theme');

// bootstrapApplication(AppComponent)
//   .catch((err) => console.error(err));

// platformBrowserDynamic()
//   .bootstrapModule(AppModule)
//   .catch(err => console.error(err));


platformBrowserDynamic().bootstrapModule(AppModule).then(ref => {
  // Ensure Angular destroys itself on hot reloads.
  if ((window as any)['ngRef']) {
    (window as any)['ngRef'].destroy();
  }
  (window as any)['ngRef'] = ref;

  // Otherwise, log the boot error
}).catch(err => console.error(err));

